from math import sqrt

def c(N):
    sqrt_N = int(sqrt(N))
    indexes = range(1, 1+sqrt_N)
    for k in xrange(sqrt_N, 0, -1):
        if indexes[-1] != N / k:
            indexes.append(N / k)
    res = {}
    for n in indexes:
        tmp = n ** 2
        if 1 < n:
            sqrt_n = int(sqrt(n))
            for l in xrange(1, sqrt_n+1):
                tmp -= res[l] * (n / l - n / (l+1))
            for d in xrange(2, 1 + n//(1+sqrt_n)):
                tmp -= res[n/d]
        res[n] = tmp
    return res[N]

print c(20)

